package com.tianshi.yingxue.controller;

import com.tianshi.yingxue.dto.PageDTO;
import com.tianshi.yingxue.dto.UserVO;
import com.tianshi.yingxue.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
@RequestMapping("/user")
public class UserController {

    @Autowired
    private UserService userService;

    @RequestMapping("/queryAllPage")
    @ResponseBody
    public UserVO queryAllPage(@RequestBody PageDTO pageDTO) {
        return userService.queryPage(pageDTO.getPage(), pageDTO.getPageSize());
    }
}